package KS;

import java.util.Arrays;
import java.util.Scanner;

public class Main {


    public static void main(String[] args) throws Exception {
         boolean fla = true;
        while (fla) {
            Scanner sc = new Scanner(System.in);
            int N = 9999999;
            String[] vexs = {"北京", "武汉","杭州", "长沙", "重庆", "上海", "南京", "西安","广水", "深圳"};
            int matrix[][] = {
                    {0, N, 40, 80, N, N, N, N, N, N},
                    {N, 0, N, 70, 60, N, 20, 20, N, N},
                    {40, N, 0, N, 20, 80, N, N, N, N},
                    {80, 70, N, 0, 90, N, N, N, N, N},
                    {N, 60, 20, 20, 0, N, N, N, N, N},
                    {N, N, 80, N, N, 0, 40, N, 10, N},
                    {N, 20, N, N, N, 40, 0, 50, N, N},
                    {N, 20, N, N, N, N,50, 0, 60, 90},
                    {N, N, N, N, N, 10, N, 60, 0, 70},
                    {N, N, N, N, N, N, N, 90, 70, 0}};



            boolean flag = true;
            int choice = 0;
            while (flag) {
                System.out.println(" ");
                System.out.println("-----------------主页---------------------------------               ");
                System.out.println("\t\t\t1、城市地图                                      " );
                System.out.println("\t\t\t2、最低成本方案及各条通信线路及造价                       ");
                System.out.println("\t\t\t3、查询建设中心机房的合理位置                              ");
                System.out.println("\t\t\t4、查找两个城市之间的最短路径                              ");
                System.out.println("\t\t\t5、退出                                                 ");
                System.out.println("--------------------------------------------------");
                System.out.print("请输入你想查找的序号： ");
                choice = sc.nextInt();
                switch (choice) {
                    case 1:
                        System.out.println("地图已打开");
                             Web.main(null);
                                  break;
                    case 2:
                        new KruskalTree(vexs, matrix).kruskal();
                        break;

                    case 3:
                        Floyd_center.findPlace(vexs, matrix);
                        break;
                    case 4:

                        Shortway.SHOW();
                        break;
                    case 5:
                        System.out.println("退出成功");
                        return;
                    default:
                        System.out.println(" 没有这个选项,请重新进入主页" );
                        break;

                }
            }

        }
    }


}